package com.zbkj.common.model.foster;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zbkj.common.model.merchant.MerchantAddress;
import com.zbkj.common.model.product.Product;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 代认养计划表
 * +----------------------------------------------------------------------
 * @author xiaolic
 * +----------------------------------------------------------------------
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("zfb_foster_plan")
@ApiModel(value="FosterPlan对象", description="代认养计划表")
public class FosterPlan implements Serializable {

    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "计划ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商品ID")
    private Integer productId;

    @ApiModelProperty(value = "认养计划名称")
    private String planName;

    @ApiModelProperty(value = "商户分类ID(逗号拼接)")
    private String cateId;

    @ApiModelProperty(value = "平台分类ID")
    private Integer categoryId;

    @ApiModelProperty(value = "商品品类")
    private String productType;

    @ApiModelProperty(value = "商品品种")
    private String productVariety;

    @ApiModelProperty(value = "种苗单价")
    private BigDecimal seedlingPrice;

    @ApiModelProperty(value = "认养周期类型(天、周、月、季度、年)")
    private String cycleType;

    @ApiModelProperty(value = "周期单价")
    private BigDecimal cyclePrice;

    @ApiModelProperty(value = "排序")
    private Integer sort;

    @ApiModelProperty(value = "商户ID")
    private Integer merchantId;

    @ApiModelProperty(value = "种苗寄送地址ID")
    private Integer addressId;

    @ApiModelProperty(value = "种苗寄送地址")
    @TableField(exist = false)
    private MerchantAddress address;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty(value = "对应的商品详情")
    @TableField(exist = false)
    private Product product;
}
